using UnityEngine;

public class BombCrate : MonoBehaviour
{
	private Explosion explode;

	public float damage;

	private void Start()
	{
		damage = 80f;
		explode = GetComponentInChildren<Explosion>();
		explode.radius = 6f;
		explode.damage = damage;
		ParticleSystem[] componentsInChildren = GetComponentsInChildren<ParticleSystem>();
		foreach (ParticleSystem particleSystem in componentsInChildren)
		{
			particleSystem.playbackSpeed = 0.5f;
		}
	}

	public void Blow(CharacterInformation shooter)
	{
		GetComponent<Collider>().enabled = false;
		explode.SetDamager(shooter, damage);
		explode.transform.parent = null;
		explode.Explode();
		UnityEngine.Object.Destroy(explode.gameObject, 4f);
		UnityEngine.Object.Destroy(base.gameObject);
	}
}
